package com.example.base_model

import android.app.Application
import androidx.multidex.MultiDex
import com.example.base_model.work.WorkScheduler

/**
 * @Author jiangKunKun
 * @CreateDate 2025/8/6
 * @Description
 * @SpittingGrooves
 */
open class BaseApp: Application() {

    companion object {
        lateinit var instance: BaseApp
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
        MultiDex.install(this)
        // App 一启动，就调度所有后台任务
        // 即使 App 被杀，系统也会按计划唤醒执行
        WorkScheduler.scheduleLogUpload(this)
        WorkScheduler.scheduleDataSync(this)
        WorkScheduler.scheduleCachePreload(this)
        WorkScheduler.scheduleDbCleanup(this)


    }

}